libname herc 'S:\Courses\stat-renaes\Stat426\data1'; data thirdqtr; set herc.mnth7_2007 herc.mnth8_2007 herc.mnth9_2007; run; proc print data=thirdqtr; run; proc contents data=herc.sales; run; proc contents data=herc.nonsales; run; data allemployees; set herc.sales herc.nonsales(rename=(First=First_Name,Last=Last_Name)); run; proc print data=allemployees; run; * most often you will use the DATA step with SET or MERGE (and a BY) to combine datasets in SAS; proc print data=hercules.shoes_eclipse; run; proc print data=hercules.shoes_tracker; run; proc contents data=hercules.shoes_eclipse; run; proc contents data=hercules.shoes_tracker; run; proc sort data=hercules.shoes_eclipse out=shoes1; by product_name; run; proc sort data=hercules.shoes_tracker out=shoes2; by product_name; run; data allshoes; set shoes1 shoes2; by product_name; run; proc print data=allshoes; var product_group product_name supplier_id; run; proc print data=hercules.orders; run; proc print data=hercules.order_item; run; proc contents data=hercules.orders; run; proc contents data=hercules.order_item; run; * use order_id for the BY variable; proc sort data=hercules.orders out=orders1; by order_id; run; proc sort data=hercules.order_item out=orders2; by order_id; run; data allorders; merge orders1 orders2; by order_ID; run; proc print data=allorders; run;